import { ajax } from '..//tools.js';

function request(path, data = {}, type = 'get') {
  return new Promise(resolve => {
    ajax({
      path,
      data,
      type,
      success: data => {
        resolve(data);
      }
    })
  })
}

export const APILogin = data => request('http://localhost/0720/denglu.php?username=${user}&&password=${pass}', data);
export const APILogin1 = data => request('http://localhost/0721/xiugai.php?uid=${uid}&password=${password}', data);
export const APILogin2 = data => request('http://localhost/0721/shanchu.php', data);

export const APIGoodsList = data => request('http://localhost/dewu/php/liebiao.php', data);
export const APIGoodsDetail = data => request('http://localhost/goods/detail.php', data);

export const APILogina = data => request('http://localhost/dewu/php/login.php', data);
export const APIRegister = data => request('http://localhost/dewu/zhuce.php', data);